package br.usp.pcs.acs.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.DecoratedTabPanel;

public class GAHome extends Composite {

	private FlightListPanel flightListPanel;
	private HorizontalPanel bottomHorizontalPanel;
	
	public GAHome() {
		{
			VerticalPanel verticalPanel = new VerticalPanel();
			initWidget(verticalPanel);
			verticalPanel.setSize("100%", "100%");
			{
				DecoratedTabPanel gaDecoratedTabPanel = new DecoratedTabPanel();
				verticalPanel.add(gaDecoratedTabPanel);
				gaDecoratedTabPanel.setSize("100%", "100%");
				{
					VerticalPanel flightsVerticalPanel = new VerticalPanel();
					gaDecoratedTabPanel.add(flightsVerticalPanel, "V\u00F4os", false);
					flightsVerticalPanel.setSize("100%", "100%");
					{
						bottomHorizontalPanel = new HorizontalPanel();
						flightsVerticalPanel.add(bottomHorizontalPanel);
						bottomHorizontalPanel.setSize("99.2%", "277px");
						{
							addFlightList();
						}
					}
				}
				{
					VerticalPanel resourcesVerticalPanel = new VerticalPanel();
					gaDecoratedTabPanel.add(resourcesVerticalPanel, "Recursos", false);
					resourcesVerticalPanel.setSize("100%", "100%");
					{
						bottomHorizontalPanel = new HorizontalPanel();
						resourcesVerticalPanel.add(bottomHorizontalPanel);
						bottomHorizontalPanel.setSize("99.2%", "277px");
						{
							addFlightList();
						}
					}
				}
				{
					VerticalPanel ciaVerticalPanel = new VerticalPanel();
					gaDecoratedTabPanel.add(ciaVerticalPanel, "Cia. A\u00E9reas", false);
					ciaVerticalPanel.setSize("100%", "100%");
					{
						bottomHorizontalPanel = new HorizontalPanel();
						ciaVerticalPanel.add(bottomHorizontalPanel);
						bottomHorizontalPanel.setSize("99.2%", "277px");
						{
							addFlightList();
						}
					}
				}
				gaDecoratedTabPanel.selectTab(0);
			}
		}
	}
	
	public void addFlightList(){

    	flightListPanel = new FlightListPanel();
		bottomHorizontalPanel.add(flightListPanel);
		flightListPanel.setWidth("100%");
    }
	
	public void addResourceList(){

    	flightListPanel = new FlightListPanel();
		bottomHorizontalPanel.add(flightListPanel);
		flightListPanel.setWidth("100%");
    }
	
	public void addCAList(){

    	flightListPanel = new FlightListPanel();
		bottomHorizontalPanel.add(flightListPanel);
		flightListPanel.setWidth("100%");
    }
}
